/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.anism.holidays.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;


/**
 *
 * @author user
 */
@Entity
@Table(name = "holidayRequests", catalog = "holidays", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HolidayRequests.findAll", query = "SELECT h FROM HolidayRequests h"),
    @NamedQuery(name = "HolidayRequests.findById", query = "SELECT h FROM HolidayRequests h WHERE h.id = :id"),
    @NamedQuery(name = "HolidayRequests.findByEndDate", query = "SELECT h FROM HolidayRequests h WHERE h.endDate = :endDate"),
    @NamedQuery(name = "HolidayRequests.findByStartDate", query = "SELECT h FROM HolidayRequests h WHERE h.startDate = :startDate"),
    @NamedQuery(name = "HolidayRequests.findByType", query = "SELECT h FROM HolidayRequests h WHERE h.type = :type"),
    @NamedQuery(name = "HolidayRequests.findByValidator", query = "SELECT h FROM HolidayRequests h WHERE h.validator = :validator"),
    @NamedQuery(name = "HolidayRequests.findByEmployee", query = "SELECT h FROM HolidayRequests h WHERE h.employee = :employee")})
public class HolidayRequests implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "endDate")
    @Temporal(TemporalType.DATE)
    private Date endDate;
    @Basic(optional = false)
    @NotNull
    @Column(name = "startDate")
    @Temporal(TemporalType.DATE)
    private Date startDate;
    @Basic(optional = false)
    @NotNull
    @Column(name = "type")
    private int type;
    @Column(name = "validator")
    private Integer validator;
    @Basic(optional = false)
    @NotNull
    @Column(name = "employee")
    private int employee;

    public HolidayRequests() {
    }

    public HolidayRequests(Integer id) {
        this.id = id;
    }

    public HolidayRequests(Integer id, Date endDate, Date startDate, int type, int employee) {
        this.id = id;
        this.endDate = endDate;
        this.startDate = startDate;
        this.type = type;
        this.employee = employee;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public Integer getValidator() {
        return validator;
    }

    public void setValidator(Integer validator) {
        this.validator = validator;
    }

    public int getEmployee() {
        return employee;
    }

    public void setEmployee(int employee) {
        this.employee = employee;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HolidayRequests)) {
            return false;
        }
        HolidayRequests other = (HolidayRequests) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.an.ism.holidays.HolidayRequests[ id=" + id + " ]";
    }
    
}
